-
-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restrict latest versions to stable highest releases only for all default repositories #2501
base: master
Are you sure you want to change the base?
Conversation
9922e02
to
15e1b85
Compare
src/main/java/org/dependencytrack/tasks/repositories/MavenMetaAnalyzer.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/tasks/repositories/MavenMetaAnalyzer.java
Show resolved
Hide resolved
🛠 Lift Auto-fixSome of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.1 # Download the patch
curl https://lift.sonatype.com/api/patch/github.com/DependencyTrack/dependency-track/2501.diff -o lift-autofixes.diff
# Apply the patch with git
git apply lift-autofixes.diff
# Review the changes
git diff Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command: curl https://lift.sonatype.com/api/patch/github.com/DependencyTrack/dependency-track/2501.diff | git apply Once you're satisfied, commit and push your changes in your project. Footnotes |
cbfe8c1
to
7d0be12
Compare
src/main/java/org/dependencytrack/tasks/repositories/AbstractMetaAnalyzer.java
Outdated
Show resolved
Hide resolved
0e71f1e
to
1289906
Compare
src/main/java/org/dependencytrack/tasks/repositories/MavenMetaAnalyzer.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/tasks/repositories/HexMetaAnalyzer.java
Outdated
Show resolved
Hide resolved
@walterdeboer, following the release of v4.8.0, this PR now has conflicts that need to be resolved before it can be merged. Please can you fix things? Then the PR can be reviewed. |
60dcb17
to
7d173d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much @walterdeboer for making these changes. Def helps to make the code more efficient/clean and 💟 the checking of stable versions aspect of it 😸
@nscuro there are no merge conflicts and it is updated with the latest changes of base branch. |
53b816c
to
30be928
Compare
@walterdeboer can you help resolve the branch conflict? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed extra changes since last approval. Thanks for additional tests @walterdeboer
@melba-lopez @walterdeboer The conflict just resolved itself after merging #2965 :) |
Thanks again @walterdeboer for the effort here. Upon further inspection, there are two major things that prevent us from merging this:
|
Thanks for the heads-up @nscuro I'll have a look how to add support for in/excluding pre-releases, i'll get back on that. |
Signed-off-by: Walter de Boer <[email protected]>
- Compiling regex Patterns to save computational effort - Documenation Co-authored-by: Niklas <[email protected]> Signed-off-by: Walter de Boer <[email protected]>
Signed-off-by: Walter de Boer <[email protected]>
…ersion matching to match different ecosystems Signed-off-by: Walter de Boer <[email protected]>
Signed-off-by: Walter de Boer <[email protected]>
…d repository metadata Signed-off-by: Walter de Boer <[email protected]>
Signed-off-by: Walter de Boer <[email protected]>
This PR fixes my major complaint with Dependency Track. Please revive this PR and get it merged. |
Description
Added a regex to determine unstable releases. Every release in the repository metadata is examined and only stable releases are considered to determine the highest version number, instead of the latest by date.
Before:
After:
Addressed Issue
closes #2500, fixes #513, fixes #1374
Additional Details
Testing is a bit hard since curernt tests need actual HTTP calls. Extracted a few utility methods for verification.
Cargo and Go report highest stable versions. Updated the other repositories to use the utility methods. All repositories now return stable highest versions when found.
Fixed inaccurate published timestamp. It also got updated when a new lower or unstable version was pushed to the repo. The published timestamp is now set only when the latest version in the metadata equals the latest stable version found so we know for sure the published timestamp belongs to that version.
Centralized all version matching in ComponentVersion, added complex version matching to match semver as well as non-semver and different ecosystems, such as debian and ubuntu, that use epoch numbers in versions, or use labels with ''ubuntu" in it. (#1374)
Checklist